/*
 * Created on 20.11.2003
 * Local Projects Database
 * Mihai Postelnicu (mihai@ro-gateway.org)
 * (comparator) 2003 by eRomania Gateway
 */
package ro.gateway.aida.obj;

import java.util.Comparator;

/**
 * @author Mihai Postelnicu
 *  OrgType
 *  Defines an org type :
 *  contains : type id and a localized string defining the name of the type
 *  e-mail (mihai@ro-gateway.org)
 * (comparator) 2003 by eRomania Gateway
 */
public class OrgType extends LocalizedItem {
	protected LangString name;
	protected int id;
	
	public OrgType() {
			super();
			this.name = new LangString();
	  } 
	
	public static class LangComparator implements Comparator {
			   protected String lang;

			   public LangComparator(String lang) {
				   this.lang = lang;
			   }

			   public int compare(Object o1, Object o2) {
				OrgType ot1 = (OrgType) o1;
				OrgType ot2 = (OrgType) o2;

				   return (ot1.getName().getString(lang).compareTo(ot2.getName().getString(lang)));
			   }
		   }  
   
	/**
	 * @return
	 */
	public int getId() {
		return id;
	}

	/**
	 * @return
	 */
	public LangString getName() {
		return name;
	}

	/**
	 * @param i
	 */
	public void setId(int i) {
		id = i;
	}

	/**
	 * @param string
	 */
	public void setName(LangString string) {
		name = string;
	}
	
	public static final String LIST = "OrgType_LIST";

}
